// getMonaco.then(monaco=>{})
export default async function getMonaco() {
    if (window.monaco) return window.monaco;
    await import(
        "https://cdn.jsdelivr.net/npm/@monaco-editor/loader@1.2.0/lib/umd/monaco-loader.min.js"
    );
    window.monaco_loader.config({
        paths: {
            vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.25.2/min/vs",
        },
        "vs/nls": {
            availableLanguages: {
                "*": "zh-cn",
            },
        },
    });

    return window.monaco_loader.init();
}
